package cn.tangshh.universal.security.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Objects;

/**
 * 用户角色抽象类
 *
 * @author Tang
 * @version v1.0
 * @since 2024/10/12
 */
@Data
@Schema(title = "用户角色抽象类")
public abstract class BasisUserRole {
    @Schema(title = "角色标识")
    private String roleCode;

    @Schema(title = "角色名称")
    private String roleName;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof BasisUserRole that)) return false;
        return Objects.equals(roleCode, that.roleCode);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(roleCode);
    }
}